.PHONY: all clean

CC		:= gcc
CCFLAGS := -I../inc/

OBJCOPY := objcopy
OBJDUMP := objdump

all: boot_sect.bin s1.bin

boot_sect.bin: boot_sect.asm s1.bin
	sh make_boot_sect.sh

s1_asm.o: s1_asm.S
	${CC} ${CCFLAGS} $< -c -o$@

s1.o: s1.c
	${CC} ${CCFLAGS} $< -c -o$@

s1.bin: s1_asm.o s1.o
	${LD} -N -e s1_asm_main -Ttext 0x8000 -o $@.out $^
	${OBJCOPY} -S -Obinary $@.out $@
	${RM} $@.out

clean:
	-${RM} boot_sect.bin
	-${RM} s1.bin
	-${RM} s1_size
	-${RM} *.o
